using System;
using LambdaGp.Core;

namespace LambdaGp.Operators.Functions.MathFunctions
{
    public class Sqr : UnaryFunction
    {
        public Sqr()
            : base("sqr")
        {
        }

        protected override Func<double> CompileUnaryToFunc(Individual individual, Func<double> argument)
        {
            return () =>
            {
                double val = argument();
                return val * val;
            };
        }
    }
}